<?php

namespace App\Repositories;

use App\Models\Permission;
use Illuminate\Database\Eloquent\Model;

/**
 * 权限模块Repository
 *
 * Date: 21/03/2018
 * @author George
 * @package App\Repositories
 */
class PermissionRepository extends BaseRepository
{
	/**
	 * 定义模型类
	 *
	 * Date: 21/03/2018
	 * @author George
	 * @return mixed|string
	 */
	public function model()
	{
		return Permission::class;
	}

	/**
	 * 序列化属性为模型实例
	 *
	 * Date: 22/03/2018
	 * @author George
	 * @param array $attributes
	 * @return Permission|Model
	 */
	protected function serialization(array $attributes)
	{
		foreach ($attributes as $key => $value) {
			$this->model->{$key} = $value;
		}
		return $this->model;
	}
}
